from toee import *

def san_heartbeat( attachee, triggerer ):
	if (game.global_flags[935] == 1):
		attachee.object_flag_unset(OF_OFF)
	if (not attachee.has_wielded(4500) or not attachee.has_wielded(4112)):
		attachee.item_wield_best_all()
		attachee.item_wield_best_all()
	return RUN_DEFAULT

def san_enter_combat( attachee, triggerer ):
#	if (not attachee.has_wielded(4082) or not attachee.has_wielded(4112)):
	if (not attachee.has_wielded(4500) or not attachee.has_wielded(4112)):
		attachee.item_wield_best_all()
#		game.new_sid = 0
	return RUN_DEFAULT

def san_start_combat( attachee, triggerer ):
	while(attachee.item_find(8903) != OBJ_HANDLE_NULL):
		attachee.item_find(8903).destroy()
	if (attachee.d20_query(Q_Is_BreakFree_Possible)):
		create_item_in_inventory( 8903, attachee )
#	if (not attachee.has_wielded(4082) or not attachee.has_wielded(4112)):
	if (not attachee.has_wielded(4500) or not attachee.has_wielded(4112)):
		attachee.item_wield_best_all()
#		game.new_sid = 0
	return RUN_DEFAULT
